
DECLARE 
@Period date,
@SLA float,
@Incentive float,
@UserID int

SET @Period = '01-Apr-2014'

--table 1
DECLARE
@TotalVolReceived int,
@TotalVolAnswered int

--SET @Period = GETDATE()
SET @UserID = 5
SET @TotalVolReceived = 24194
SET @TotalVolAnswered = 21976
SET @SLA = 95

EXEC sprocSummaryReportInsertUpdateSingleItem @Period = @Period, @TableNo = 1, @NInfo1 = @TotalVolReceived, @NInfo2 = @TotalVolAnswered, @UserID = @UserID

--table 2
DECLARE 
@TotalVolAnsweredWithin30s int
SET @TotalVolAnsweredWithin30s = 11806
EXEC sprocSummaryReportInsertUpdateSingleItem @Period = @Period, @TableNo = 2, @NInfo1 = @TotalVolAnsweredWithin30s, @UserID = @UserID

--table 3
DECLARE 
@TotalVolAbandon int
SET @TotalVolAbandon = 1999
EXEC sprocSummaryReportInsertUpdateSingleItem @Period = @Period, @TableNo = 3, @NInfo1 = @TotalVolAbandon, @UserID = @UserID

--table 4
DECLARE 
@TotalEscalatedCallsClosed int,
@EscalatedCallWithin1WorkingDay int
SET @TotalEscalatedCallsClosed = 619
SET @EscalatedCallWithin1WorkingDay = 619
EXEC sprocSummaryReportInsertUpdateSingleItem @Period = @Period, @TableNo = 4, @NInfo1 = @TotalEscalatedCallsClosed, @NInfo2 = @EscalatedCallWithin1WorkingDay, @UserID = @UserID

--table 5
DECLARE 
@TotalVolFCR int
SET @TotalVolFCR = 21366
EXEC sprocSummaryReportInsertUpdateSingleItem @Period = @Period, @TableNo = 5, @NInfo1 = @TotalVolFCR, @UserID = @UserID

--table 6
DECLARE 
@TotalVolVM int,
@TotalVolVMAnsweredWithin60Mins int
SET @TotalVolVM = 211
SET @TotalVolVMAnsweredWithin60Mins = 179
EXEC sprocSummaryReportInsertUpdateSingleItem @Period = @Period, @TableNo = 6, @NInfo1 = @TotalVolVM, @NInfo2 = @TotalVolVMAnsweredWithin60Mins, @UserID = @UserID

--table 7 (Manual)
EXEC sprocSummaryReportInsertUpdateSingleItem @Period = @Period, @TableNo = 7, @NInfo1 = 3, @NInfo2 = 3, @UserID = @UserID

--table 8
DECLARE 
@TotalNonEscalatedCase int,
@TotalNonEscalatedCaseClosedWithin1Day int
SET @TotalNonEscalatedCase = @TotalVolFCR
SET @TotalNonEscalatedCaseClosedWithin1Day = 20962
EXEC sprocSummaryReportInsertUpdateSingleItem @Period = @Period, @TableNo = 8, @NInfo1 = @TotalNonEscalatedCase, @NInfo2 = @TotalNonEscalatedCaseClosedWithin1Day, @UserID = @UserID

--table 9
DECLARE 
@TotalVolEmailClosed int,
@TotalVolEmailClosedWithin3WorkingDay int
SET @TotalVolEmailClosed = 3127
SET @TotalVolEmailClosedWithin3WorkingDay = 3033
EXEC sprocSummaryReportInsertUpdateSingleItem @Period = @Period, @TableNo = 9, @NInfo1 = @TotalVolEmailClosed, @NInfo2 = @TotalVolEmailClosedWithin3WorkingDay, @UserID = @UserID

DECLARE 
@TotalVolAAClosed int,
@TotalVolAAClosedWithin3WorkingDay int
SET @TotalVolAAClosed = 1206
SET @TotalVolAAClosedWithin3WorkingDay = 1167
EXEC sprocSummaryReportInsertUpdateSingleItem @Period = @Period, @TableNo = 91, @NInfo1 = @TotalVolAAClosed, @NInfo2 = @TotalVolAAClosedWithin3WorkingDay, @UserID = @UserID

DECLARE 
@TotalVolDEmailClosed int,
@TotalVolDEmailClosedWithin3WorkingDay int
SET @TotalVolDEmailClosed = 1921
SET @TotalVolDEmailClosedWithin3WorkingDay = 1866
EXEC sprocSummaryReportInsertUpdateSingleItem @Period = @Period, @TableNo = 92, @NInfo1 = @TotalVolDEmailClosed, @NInfo2 = @TotalVolDEmailClosedWithin3WorkingDay, @UserID = @UserID

--table 10
--table 1 (Vol Answered) + table 6 (VM Handled)

--table 11
DECLARE 
@TotalVolCaseLogged int,
@TotalVolNonChargeableCase int
SET @TotalVolCaseLogged = 22187
SET @TotalVolNonChargeableCase = 199
EXEC sprocSummaryReportInsertUpdateSingleItem @Period = @Period, @TableNo = 11, @NInfo1 = @TotalVolCaseLogged, @NInfo2 = @TotalVolNonChargeableCase, @UserID = @UserID

--table 12
--A) NON-Chargeable Items
DECLARE 
@NonChargeableACRAOfficer int,
@NonChargeableAuditShortCall int,
@NonChargeableEmptyVM int

SET @NonChargeableACRAOfficer = 5
SET @NonChargeableAuditShortCall = 194
SET @NonChargeableEmptyVM = 0
EXEC sprocSummaryReportInsertUpdateSingleItem @Period = @Period, @TableNo = 121, @NInfo1 = @NonChargeableACRAOfficer, @NInfo2 = @NonChargeableAuditShortCall, @NInfo3 = @NonChargeableEmptyVM,  @UserID = @UserID

--B) Chargeable Items
DECLARE 
@ChargeableRepeatedCall int,
@ChargeableLookingForACRA int,
@ChargeableUncontableVM int

SET @ChargeableRepeatedCall = 154
SET @ChargeableLookingForACRA = 208
SET @ChargeableUncontableVM = 47
EXEC sprocSummaryReportInsertUpdateSingleItem @Period = @Period, @TableNo = 122, @NInfo1 = @ChargeableRepeatedCall, @NInfo2 = @ChargeableLookingForACRA, @NInfo3 = @ChargeableUncontableVM,  @UserID = @UserID

--table 13
DECLARE 
@Survey4Out6PointScale int,
@TotalSurveyResponse int

SET @Survey4Out6PointScale = 311
SET @TotalSurveyResponse = 370

EXEC sprocSummaryReportInsertUpdateSingleItem @Period = @Period, @TableNo = 13, @NInfo1 = @Survey4Out6PointScale, @NInfo2 = @TotalSurveyResponse, @UserID = @UserID

DECLARE 
@IVRSurvey4Out6PointScale int,
@IVRTotalSurveyResponse int

SET @IVRSurvey4Out6PointScale = 293
SET @IVRTotalSurveyResponse = 345

EXEC sprocSummaryReportInsertUpdateSingleItem @Period = @Period, @TableNo = 131, @NInfo1 = @IVRSurvey4Out6PointScale, @NInfo2 = @IVRTotalSurveyResponse, @UserID = @UserID

DECLARE 
@EmailSurvey4Out6PointScale int,
@EmailTotalSurveyResponse int

SET @EmailSurvey4Out6PointScale = 18
SET @EmailTotalSurveyResponse = 25

EXEC sprocSummaryReportInsertUpdateSingleItem @Period = @Period, @TableNo = 132, @NInfo1 = @EmailSurvey4Out6PointScale, @NInfo2 = @EmailTotalSurveyResponse, @UserID = @UserID

select * from tblSummaryReport Where Period = @Period
